<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <script>
        // keyup不区分大小写
        // document.addEventListener('keyup', function (e) {
        //     console.log(e.keyCode);
        // })

        // 我们可以利用keyCode返回的ASSCII码值来判断用户按下那个键

        // keypress区分大小写    不识别功能键 
        document.addEventListener('keypress', function (e) {
            console.log(e.keyCode);
        })
    </script>
</body>

</html>